<template>
<div class="app">
    <h2 ref="reftitle">标题</h2>
    <button ref="refbutton">按钮</button>
</div>
</template>
<script>
import { ref,onMounted } from "vue"
export default {
    setup() {
        const reftitle = ref()
        const refbutton = ref()
        onMounted(() => {
            console.log(reftitle.value)
            console.log(refbutton.value)
        })
        return {
            refbutton,
            reftitle
        }
    }
}
</script>
<style scoped lang="less">

</style>